var TreeSelector = function(g, f, h, e, c) {
	var d = {
		id : g,
		store : new Ext.data.SimpleStore({
					fields : [],
					data : [[]]
				}),
		editable : false,
		mode : "local",
		fieldLabel : h,
		allowBlank : c == false ? false : true,
		triggerAction : "all",
		maxHeight : 200,
		width : 165,
		selectOnFocus : false,
		tpl : "<tpl for='.'><div style='height:200px;'><div id='" + g
				+ "tree'></div></div></tpl>",
		selectedClass : ""
	};
	var b = new Ext.form.ComboBox(d);
	var a = new Ext.tree.TreePanel({
				id : g + "Tree",
				height : 200,
				autoScroll : true,
				split : true,
				loader : new Ext.tree.TreeLoader({
							url : f
						}),
				root : new Ext.tree.AsyncTreeNode({
							expanded : true
						}),
				rootVisible : false
			});
	a.on("collapsenode", function(i) {
				b.expand();
			});
	a.on("expandnode", function(i) {
				b.expand();
			});
	a.on("click", function(j) {
				a.clickNodes = true;
				var i = Ext.getCmp(e);
				if (j.id != null && j.id != "") {
					b.setValue(j.text);
					b.id = j.id;
					b.collapse();
					if (i != null) {
						i.setValue(j.id);
					}
				}
			});
	b.on("expand", function() {
				a.render(g + "tree");
			});
	return b;
};